package cq.zhcqk.activity;

import android.view.View;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.TextView;

import cq.zhcqk.R;
import cq.zhcqk.base.BaseActivity;
import cq.zhcqk.util.Common;

/**
 * Created by zhangle on 2018/1/23.
 */
public class JdMapActivity extends BaseActivity implements View.OnClickListener{
    private String address;
    private WebView mapweb;
    private String mapBase = "http://apis.map.qq.com/uri/v1/marker?marker=coord:'';title:'';addr:手帕口桥北铁路道口&referer=myapp";
    @Override
    protected void initView() {
        setContentView(R.layout.activity_jd_map);
        address = getIntent().getStringExtra("address");
        mapweb = (WebView) findViewById(R.id.mapweb);
        initBack();
    }

    @Override
    protected void initData() {
//        mapweb.loadUrl("http://apis.map.qq.com/uri/v1/marker?marker=coord:'';title:'';addr:"+address+"&referer=myapp");
        mapweb.loadUrl("http://apis.map.qq.com/uri/v1/marker?marker=coord:39.892326,116.342763;title:超好吃冰激凌;addr:手帕口桥北铁路道口&referer=myapp");
    }

    private void initBack(){
        ImageView back = (ImageView) findViewById(R.id.header_back);
        TextView title = (TextView) findViewById(R.id.header_text);
        title.setText("导航");
        back.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.header_back:
                finish();
                break;
        }
    }
}
